//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Example #15—String Class Example
// CS 151, 6 Apr 2009
// ECC, Spring 2009
// Niko Culevski
// Program to demonstrate converting Strings into
// primitive data types
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class TestConversions
{
    public static void main(String args[])
    {
        String today = "April 18, 2009";
        String todaysDayString = today.substring(6, 8);
        int todaysDayInt = Integer.parseInt(todaysDayString);
        int nextWeeksDayInt = todaysDayInt + 7;
        String nextWeek = today.substring(0, 6) + nextWeeksDayInt
            + today.substring(8);
        System.out.println("Today's date is " + today);
        System.out.println("Today's day is " + todaysDayInt);
        System.out.println("Next week's day is " + nextWeeksDayInt);
        System.out.println("Next week's date is " + nextWeek);
    }
}
